﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xinkui.Entity.AutoGenerator;
using DataFrameworkAccess;
using Xinkui.Common;

namespace Xinkui.DataAccess.AutoGenerator {
    public partial class EquipmentInfoDataAccess {
        public List<EquipmentInfo_Entity> EquipmentInfo_ListByCompany(int companyId) {
            try {

                DataCommand cmd = DataCommandManager.GetDataCommand("EquipmentInfo_ListByCompany");
                cmd.SetParameterValue("@CompanyId", companyId);
                List<EquipmentInfo_Entity> pageList = cmd.ExecuteEntityList<EquipmentInfo_Entity>();
                return pageList;
            }
            catch (Exception ex) {
                ExceptionHelper.ProcessException(ex);
            }

            return new List<EquipmentInfo_Entity>(0);

        }


        public List<EquipmentInfoMaintain_Entity> EquipmentInfoMaintain_ListByCompany(int companyid, int pageSize, int pageIndex, out int total) {
            total = 0;
            try {
                int tempRecord = 0;
                DataCommand cmd = DataCommandManager.GetDataCommand("EquipmentInfoMaintain_ListByCompany");
                cmd.SetParameterValue("@PageSize", pageSize);
                cmd.SetParameterValue("@PageIndex", pageIndex);
                cmd.SetParameterValue("@CompanyId", companyid);
                cmd.SetParameterValue("@RecordCount", tempRecord);
                List<EquipmentInfoMaintain_Entity> pageList = cmd.ExecuteEntityList<EquipmentInfoMaintain_Entity>();
                total = Convert.ToInt32(cmd.GetParameterValue("@RecordCount"));
                return pageList;
            }
            catch (Exception ex) {
                ExceptionHelper.ProcessException(ex);
            }

            return new List<EquipmentInfoMaintain_Entity>(0);

        }


    }
}
